home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 1
/
Nebula One.iso
/
Utilities
/
Converters
/
Convert_FONT
/
Source
/
shared.subproj
/
RCS
/
common.c,v
< prev
next >
Wrap
Text File
|
1995-06-12
|
2KB
|
110 lines
head 1.3;
branch ;
access ;
symbols beta10:1.2;
locks death:1.3;
comment @ * @;
1.3
date 93.04.04.23.45.33; author death; state Exp;
branches ;
next 1.2;
1.2
date 93.01.10.15.08.59; author death; state Exp;
branches ;
next 1.1;
1.1
date 92.07.26.13.56.59; author death; state Exp;
branches ;
next ;
desc
@Update
@
1.3
log
@Sun Apr 4 23:45:32 PDT 1993
@
text
@#import "common.h"
#import <stdlib.h>
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This function takes an unsigned number, and returns YES if the number is
// even, and NO otherwise.
// This test is accomplished simply by getting the remainder of dividing the number
// by 2. This remainder will always be either 0 or 1. If it is 1, then theNum was
// odd, otherwise it was even.
// This function is included here because this is occasionally a thing I need to make
// use of, but alas I always end up spending too much time remembering the operators
// needed to do it again.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Boolean EvenUnsignedNum (PositiveInteger theNum)
{
if ((theNum % 2) == 1)
return NO;
else
return YES;
}
CString NewCString(PositiveInteger length)
{
CString temp = (CString) malloc(length+1);
temp[0] = EndOfCString;
return temp;
}
void FreeCString(CString theString)
{
free((char*)theString);
}
ByteString NewByteString(PositiveInteger length)
{
return (ByteString) malloc(length);
}
void FreeByteString(ByteString theString)
{
free((char*)theString);
}
Pointer NewPointer(PositiveInteger length)
{
return (Pointer) malloc(length);
}
void FreePointer(Pointer thePointer)
{
free((char*)thePointer);
}
@
1.2
log
@Sun Jan 10 15:08:58 PST 1993
@
text
@@
1.1
log
@Initial revision
@
text
@d25 3
a27 1
return (CString) malloc(length+1);
@